/* ================================================================================
//	Crypteviant!
//	Providing tough encrypted P2P Chat
//	Copyright (C) 2010  Martin Pfeifer, Tobias Rausch
//
//	This program is free software: you can redistribute it and/or modify
//	it under the terms of the GNU General Public License as published by
//	the Free Software Foundation, either version 3 of the License, or
//	(at your option) any later version.
//
//	This program is distributed in the hope that it will be useful,
//	but WITHOUT ANY WARRANTY; without even the implied warranty of
//	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//	GNU General Public License for more details.
//
//	You should have received a copy of the GNU General Public License
//	along with this program.  If not, see <http://www.gnu.org/licenses/>.
// ============================================================================== */

#ifndef ENTROPYDATASTRUCT_HPP
#define ENTROPYDATASTRUCT_HPP

#include <QtCore/QString>
#include <QtCore/QMetaType>


namespace RandomPool {

    /**
     * @brief Struct containing Information about collected random data
     * @details This struct should be used to emit newly generated random data.\n
     * The data will be added to the specified Pool asynchronously.\n
     * Please make sure that you loop through the whole amount of Pools to spread the data.
     *
     * @class EntropyDataStruct EntropyDataStruct.hpp "EntropyDataStruct.hpp"
    */
    struct EntropyDataStruct
    {
        /**
         * @var sourceId
         * @brief The ID of the Source which has generated the data
        */
        unsigned int sourceId;

        /**
         * @var poolId
         * @brief The ID of the Pool to which the data should be added
         * @details You can just count the ID up every time you add new data because the Manager handles too high
         * values for the poolId for you.
        */
        unsigned int poolId;

        /**
         * @var data
         * @brief Contains the random data. Must be converted to string..
        */
        QString data;

        /**
         * @var timestamp
         * @brief Add a Timestamp (ms accuracy) when this data was generated to avoid too old data
         * @details Use QDateTime::currentMSecsSinceEpoch() for this
        */
        qint64 timestamp;
    };

} // End of Namespace RandomPool

Q_DECLARE_METATYPE(RandomPool::EntropyDataStruct);

#endif // ENTROPYDATASTRUCT_HPP
